<?php

namespace App\Models\Company;

use Illuminate\Database\Eloquent\Model;

class CompanyJob extends Model{
    //设置表的类型和表名
    protected $table = 'company_job';
    protected $primaryKey = 'id';
    public $timestamps = false;
    protected $guarded = [];

    //企业基本信息和职位一对一关系
    public function job_company(){
        return $this->hasOne('App\Models\Company\CompanyBasic','id','com_id');
    }
    //查询 企业和企业发布的工作
    public  function company_basic(){//
        return $this->belongsTo('App\Models\Company\CompanyBasic','com_id','id');
    }
    //查询岗位与人才是否已被收藏
    public  function personnelIsHaveInsert(){//
        return $this->belongsTo('App\Models\Company\ResumeFavorite','id','job_id');
    }
}